(use-modules
 ;; SRFI 64 for unit testing facilities
 (srfi srfi-64)
 (utils string))


(test-begin "string-utils-test")

(test-group
 "stringify"

 (test-equal "stringify-positive-number"
   "1"
   (stringify 1))

 (test-equal "stringify-negative-number"
   "-1"
   (stringify -1))

 (test-equal "stringify-string-remains-the-same"
   "123"
   (stringify "123"))

 (test-equal "stringify-float"
   "3.14"
   (stringify 3.14))

 (test-equal "stringify-other"
   "ab1"
   (stringify 'ab1)))

(test-group
 "n-times-string"

 (test-equal "n-times-string-1"
   "ababab"
   (n-times-string "ab" 3))

 (test-equal "n-times-string-2"
   "ab\nab\n"
   (n-times-string "ab\n" 2))

 (test-equal "n-times-string with 0 times the string should be empty string"
   ""
   (n-times-string "ab\n" 0)))

(test-end "string-utils-test")
